package me.zhengjie.modules.weixin.message.reply;


import me.zhengjie.modules.weixin.enums.WeChatMsgTypeEnum;
import org.apache.commons.lang3.StringUtils;

public class ReplyMusicMessage extends AbstractReplyMessage {

    public ReplyMusicMessage() {
        super();
        setMsgType(WeChatMsgTypeEnum.music.name());
    }

    public ReplyMusicMessage(String title, String description, String musicUrl, String hQMusicUrl, String thumbMediaId) {
        this();
        MusicMessage music = new MusicMessage();
        music.Title = title;
        music.Description = description;
        music.MusicUrl = musicUrl;
        music.HQMusicUrl = hQMusicUrl;
        music.ThumbMediaId = thumbMediaId;
        this.Music = music;
    }

    private MusicMessage Music;

    public MusicMessage getMusic() {
        return Music;
    }

    public void setMusic(MusicMessage music) {
        Music = music;
    }

    public static class MusicMessage {

        private String Title;

        private String Description;

        private String MusicUrl;

        private String HQMusicUrl;

        private String ThumbMediaId;

        public String getTitle() {
            return Title;
        }

        public void setTitle(String title) {
            Title = title;
        }

        public String getDescription() {
            return Description;
        }

        public void setDescription(String description) {
            Description = description;
        }

        public String getMusicUrl() {
            return MusicUrl;
        }

        public void setMusicUrl(String musicUrl) {
            MusicUrl = musicUrl;
        }

        public String getHQMusicUrl() {
            return HQMusicUrl;
        }

        public void setHQMusicUrl(String HQMusicUrl) {
            this.HQMusicUrl = HQMusicUrl;
        }

        public String getThumbMediaId() {
            return ThumbMediaId;
        }

        public void setThumbMediaId(String thumbMediaId) {
            ThumbMediaId = thumbMediaId;
        }
    }

    @Override
    public boolean isValidReply() {

        return null != Music && StringUtils.isNotBlank(Music.ThumbMediaId);
    }
}
